package com.example.demo.service;

import com.example.demo.entity.ArtInfo;
import com.example.demo.entity.UserInfo;
import com.example.demo.mapper.ArtMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author CY
 * @date 2023/03/14 16:16
 **/
@Service
public class ArtService {
    @Autowired
    private ArtMapper artMapper;

    public List<ArtInfo> getMyArt(Integer uid) {
        return artMapper.getMyArt(uid);
    }

    public ArtInfo getArtById(Integer aid) {
        return artMapper.getArtById(aid);
    }
    public Integer updateArt(Integer aid,Integer uid,String title,String content){
        return artMapper.updateArt(aid,uid,title,content);
    }
    public Integer insert (Integer uid,String title, String content){
        return artMapper.insert(uid,title,content);
    }

    public Integer delete(Integer uid,Integer id){
        return artMapper.delete(uid,id);
    }
    public List<ArtInfo> getAllList(Integer pageSize,Integer offset){
        return artMapper.getAllList(pageSize,offset);
    }
    public Integer getPages(Integer psize){
        return artMapper.getPages(psize);
    }




}
